package com.tedu.bill.demo2;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

/**
 * Author：毕龙
 * Date: 2024/5/26 15:16
 */
public class TestInputStream {
    public static void main(String[] args) throws IOException {
        //创建file对象
        File file = new File("day14/src/a.txt");

        //创建输入流对象
        FileInputStream fis = new FileInputStream(file);

        //获取文件中的字节
        //int read = fis.read();
        int read;
        while ((read = fis.read()) != -1){
            //打印
            System.out.println((char)read);
            //read = fis.read();
        }

        //释放资源
        fis.close();
    }
}
